HAL MMC I/O operation functions ¶
This section maps HAL1 MMC I/O operation APIs to their HAL2 equivalents.
HAL MMC transfer in polling mode ¶
|
HAL1 |
HAL2 |
|---|---|
HAL_StatusTypeDef HAL_MMC_ReadBlocks(MMC_HandleTypeDef *hmmc,
uint8_t *pData,
uint32_t BlockAdd,
uint32_t NumberOfBlocks,
uint32_t Timeout)
|
hal_status_t HAL_MMC_ReadBlocks(hal_mmc_handle_t *hmmc,
uint8_t *p_data,
uint32_t block_addr,
uint32_t blocks_nbr,
uint32_t timeout_ms)
|
|
HAL1 |
HAL2 |
|---|---|
HAL_StatusTypeDef HAL_MMC_WriteBlocks(MMC_HandleTypeDef *hmmc,
const uint8_t *pData,
uint32_t BlockAdd,
uint32_t NumberOfBlocks,
uint32_t Timeout)
|
hal_status_t HAL_MMC_WriteBlocks(hal_mmc_handle_t *hmmc,
const uint8_t *p_data,
uint32_t block_addr,
uint32_t blocks_nbr,
uint32_t timeout_ms)
|
HAL MMC transfer using interrupt ¶
|
HAL1 |
HAL2 |
|---|---|
HAL_StatusTypeDef HAL_MMC_ReadBlocks_IT(MMC_HandleTypeDef *hmmc,
uint8_t *pData,
uint32_t BlockAdd,
uint32_t NumberOfBlocks)
|
hal_status_t HAL_MMC_ReadBlocks_IT(hal_mmc_handle_t *hmmc,
uint8_t *p_data,
uint32_t block_addr,
uint32_t blocks_nbr)
|
|
HAL1 |
HAL2 |
|---|---|
HAL_StatusTypeDef HAL_MMC_WriteBlocks_IT(MMC_HandleTypeDef *hmmc,
const uint8_t *pData,
uint32_t BlockAdd,
uint32_t NumberOfBlocks)
|
hal_status_t HAL_MMC_WriteBlocks_IT(hal_mmc_handle_t *hmmc,
uint8_t *p_data,
uint32_t block_addr,
uint32_t blocks_nbr)
|
Note
-
In non-blocking transfer, the HAL2 write API no longer qualifies the data pointer parameter as
const. -
HAL1 driver used to have separate internal fields for transmit and receive data pointers. At the other hand the peripheral could be in one and only transfer mode, either receive or transmit until transfer completion.
HAL2 driver uses a single internal field to hold the data pointer for both transmit and receive operations. Because receive requires a non-const pointer to store incoming data, the shared field must be non-const to support both directions; therefore, the write parameter is also non-const.
HAL MMC transfer using DMA ¶
|
HAL1 |
HAL2 |
|---|---|
HAL_StatusTypeDef HAL_MMC_ReadBlocks_DMA(MMC_HandleTypeDef *hmmc,
uint8_t *pData,
uint32_t BlockAdd,
uint32_t NumberOfBlocks)
|
hal_status_t HAL_MMC_ReadBlocks_DMA(hal_mmc_handle_t *hmmc,
uint8_t *p_data,
uint32_t block_addr,
uint32_t blocks_nbr)
|
|
HAL1 |
HAL2 |
|---|---|
HAL_StatusTypeDef HAL_MMC_WriteBlocks_DMA(MMC_HandleTypeDef *hmmc,
const uint8_t *pData,
uint32_t BlockAdd,
uint32_t NumberOfBlocks)
|
hal_status_t HAL_MMC_WriteBlocks_DMA(hal_mmc_handle_t *hmmc,
uint8_t *p_data,
uint32_t block_addr,
uint32_t blocks_nbr)
|
Note
-
In non-blocking transfer, the HAL2 write API no longer qualifies the data pointer parameter as
const. -
HAL1 driver used to have separate internal fields for transmit and receive data pointers. At the other hand the peripheral could be in one and only transfer mode, either receive or transmit until transfer completion.
HAL2 driver uses a single internal field to hold the data pointer for both transmit and receive operations. Because receive requires a non-const pointer to store incoming data, the shared field must be non-const to support both directions; therefore, the write parameter is also non-const.
HAL MMC RPMB input/output operations ¶
|
HAL1 |
HAL2 |
|---|---|
HAL_StatusTypeDef HAL_MMC_RPMB_WriteBlocks(MMC_HandleTypeDef *hmmc,
const uint8_t *pData,
uint16_t BlockAdd,
uint16_t NumberOfBlocks,
const uint8_t *pMAC,
uint32_t Timeout)
|
hal_status_t HAL_MMC_WriteRPMBBlocks(hal_mmc_handle_t *hmmc,
uint8_t *p_data,
uint32_t block_addr,
uint32_t blocks_nbr,
uint8_t *p_mac,
uint32_t timeout_ms)
|
|
HAL1 |
HAL2 |
|---|---|
HAL_StatusTypeDef HAL_MMC_RPMB_ReadBlocks(MMC_HandleTypeDef *hmmc,
uint8_t *pData,
uint16_t BlockAdd,
uint16_t NumberOfBlocks,
const uint8_t *pNonce,
uint8_t *pMAC,
uint32_t Timeout)
|
hal_status_t HAL_MMC_ReadRPMBBlocks(hal_mmc_handle_t *hmmc,
uint8_t *p_data,
uint32_t block_addr,
uint32_t blocks_nbr,
uint8_t *p_nonce,
uint8_t *p_mac,
uint32_t timeout_ms)
|
HAL MMC linked-list DMA ¶
Important
Linked-list management operations are now unified under the new HAL Q layer. The following tables detail the updated APIs for linked-list handling in HAL MMC. For practical guidance, see HAL MMC linked-list use case.
|
HAL1 |
HAL2 |
|---|---|
HAL_StatusTypeDef HAL_MMCEx_DMALinkedList_ReadBlocks(MMC_HandleTypeDef *hmmc,
const MMC_DMALinkedListTypeDef *pLinkedList,
uint32_t BlockAdd,
uint32_t NumberOfBlocks)
|
hal_status_t HAL_MMC_ReadBlocks_LinkedList(hal_mmc_handle_t *hmmc,
uint32_t block_addr,
uint32_t blocks_nbr,
const hal_q_t *p_q)
|
|
HAL1 |
HAL2 |
|---|---|
HAL_StatusTypeDef HAL_MMCEx_DMALinkedList_WriteBlocks(MMC_HandleTypeDef *hmmc,
const MMC_DMALinkedListTypeDef *pLinkedList,
uint32_t BlockAdd,
uint32_t NumberOfBlocks)
|
hal_status_t HAL_MMC_WriteBlocks_LinkedList(hal_mmc_handle_t *hmmc,
uint32_t block_addr,
uint32_t blocks_nbr,
const hal_q_t *p_q)
|
|
HAL1 |
HAL2 |
|---|---|
HAL_StatusTypeDef HAL_MMCEx_DMALinkedList_BuildNode(MMC_DMALinkNodeTypeDef *pNode,
MMC_DMALinkNodeConfTypeDef *pNodeConf)
|
hal_status_t HAL_MMC_FillNodeConfig(hal_mmc_node_t *p_node,
void *p_buffer,
uint32_t size_byte)
Note The configuration structure is removed; pass configuration parameters directly. Refer to HAL MMC node configuration. |
|
HAL1 |
HAL2 |
|---|---|
HAL_StatusTypeDef HAL_MMCEx_DMALinkedList_InsertNode(MMC_DMALinkedListTypeDef *pLinkedList,
MMC_DMALinkNodeTypeDef *pPrevNode,
MMC_DMALinkNodeTypeDef *pNewNode)
|
Removed; use the HAL Q API HAL_Q_InsertNode(hal_q_t *p_q,
hal_mmc_node_t *p_prev_node,
hal_mmc_node_t *p_new_node)
|
|
HAL1 |
HAL2 |
|---|---|
HAL_StatusTypeDef HAL_MMCEx_DMALinkedList_RemoveNode(MMC_DMALinkedListTypeDef *pLinkedList,
MMC_DMALinkNodeTypeDef *pNode)
|
Removed; use the HAL Q API HAL_Q_RemoveNode(hal_q_t *p_q,
hal_mmc_node_t *p_node)
|
|
HAL1 |
HAL2 |
|---|---|
HAL_StatusTypeDef HAL_MMCEx_DMALinkedList_LockNode(
MMC_DMALinkNodeTypeDef *pNode)
HAL_StatusTypeDef HAL_MMCEx_DMALinkedList_UnlockNode(
MMC_DMALinkNodeTypeDef *pNode)
|
hal_status_t HAL_MMC_SetNodeDataBufferState(hal_mmc_node_t *p_node,
hal_mmc_node_state_t state)
Note
|
|
HAL1 |
HAL2 |
|---|---|
HAL_StatusTypeDef HAL_MMCEx_DMALinkedList_EnableCircularMode(
SDMMC_DMALinkedListTypeDef *pLinkedList)
HAL_StatusTypeDef HAL_MMCEx_DMALinkedList_DisableCircularMode(
SDMMC_DMALinkedListTypeDef *pLinkedList)
|
hal_status_t HAL_Q_SetCircularLinkQ_Head(hal_q_t *p_q)
hal_status_t HAL_Q_ClearCircularLinkQ(hal_q_t * p_q)
|
HAL MMC multi-buffer DMA ¶
|
HAL1 |
HAL2 |
|---|---|
HAL_StatusTypeDef HAL_MMCEx_ConfigDMAMultiBuffer(MMC_HandleTypeDef *hmmc,
uint32_t *pDataBuffer0,
uint32_t *pDataBuffer1,
uint32_t BufferSize)
HAL_StatusTypeDef HAL_MMCEx_ReadBlocksDMAMultiBuffer(MMC_HandleTypeDef *hmmc,
uint32_t BlockAdd,
uint32_t NumberOfBlocks)
HAL_StatusTypeDef HAL_MMCEx_WriteBlocksDMAMultiBuffer(MMC_HandleTypeDef *hmmc,
uint32_t BlockAdd,
uint32_t NumberOfBlocks)
HAL_StatusTypeDef HAL_MMCEx_ChangeDMABuffer(MMC_HandleTypeDef *hmmc,
HAL_MMCEx_DMABuffer_MemoryTypeDef Buffer,
uint32_t *pDataBuffer)
|
Multi-buffering is available only in some STM32 series. These series are not yet supported in HAL2. |
HAL MMC abort transfer operations ¶
|
HAL1 |
HAL2 |
|---|---|
HAL_StatusTypeDef HAL_MMC_Abort(MMC_HandleTypeDef *hmmc)
|
hal_status_t HAL_MMC_Abort(hal_mmc_handle_t *hmmc)
|
|
HAL1 |
HAL2 |
|---|---|
HAL_StatusTypeDef HAL_MMC_Abort_IT(MMC_HandleTypeDef *hmmc)
|
hal_status_t HAL_MMC_Abort_IT(hal_mmc_handle_t *hmmc)
|